<extend name="Index/base"/>
<block name="main">
	<section class="section main">
		<div class="clearfix con-main" id="mainContainer">
			<div class="con-left">
				<div class="panel" id="siderBox">
					<ul class="switch-section">
						<li><a href="{:U('/show/'.$doc['id'])}"><span class="icon-left"></span> 返回文档</a></li>
						<if condition="$doc['bid']">
							<li><a href="//bbs.wooo.wang/{$doc['bid']}"><span class="icon-right"></span> 进入社区</a></li>
						</if>
						<li><a href="{:U('/set/'.$doc['id'])}" class="red"><span class="icon-setting"></span> 设置文档</a></li>
						<li><a href="{:U('/hide/'.$doc['id'])}"><span class="icon-eye"></span> 隐藏文档</a></li>
						<li><a href="{:U('/freeze/'.$doc['id'])}"><span class="icon-alert"></span> 冻结文档</a></li>
					</ul>
				</div>
			</div>
			<div class="con-right">
				<div class="panel other">
					<div class="panel-header">
						<h1 class="topic-title">设置文档<span class="icon-sum" id="toggleBtn" onclick="$('#mainContainer').toggleClass('toggle-side-mark');"></span></h1>
						<p class="topic-info">
							<a href="//doc.wooo.wang/show/{$doc['id']}">{$doc['name']}</a> • 设置文档的相关信息（如：封面、名称、简介等）。
						</p>
					</div>
					<div class="panel-body">
						<form action="{:U('/set/'.$doc['id'])}" class="setBook create form" method="POST">
							<div class="form-item">
								<div id="setBookImg" data-token="{$token|default=''}">
									<img src="//img.wooo.wang/{$doc.img}" title="设置文档封面">
									<p style="text-align:center;">点击修改封面（图片宽高比例为5:7）</p>
								</div>
								<p></p>
							</div>
							<input type="hidden" id="img" name="img" value="{$doc.img}">
							<div class="form-item">
								<input type="text" name="name" id="name" placeholder="文档标题" value="{$doc.name}">
								<p></p>
							</div>
							<div class="form-item">
								<textarea name="desc" id="desc" placeholder="文档概述...">{$doc.desc}</textarea>
								<p></p>
							</div>
							<div class="form-item">
								<span>普通用户是否能够修改文档：</span>
								<div class="cate-list">
									<input type="radio" name="can_edit" value="0" <if condition="$doc['can_edit'] eq 0">checked="checked"</if> /> 可修改 &nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="can_edit" value="-1" <if condition="$doc['can_edit'] eq -1">checked="checked"</if> /> 不可修改
								</div>
								<p class="cate-msg"></p>
							</div>
							<div class="form-item">
								<span>管理员修改文档是否需审核：</span>
								<div class="cate-list">
									<input type="radio" name="need_review" value="0" <if condition="$doc['need_review'] eq 0">checked="checked"</if> /> 需审核 &nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="need_review" value="-1" <if condition="$doc['need_review'] eq -1">checked="checked"</if> /> 不需审核
								</div>
								<p class="cate-msg"></p>
							</div>
							<div class="form-item">
								<input type="hidden" name="cateid" id="cateInput" value="{$doc.class}">
								<span>请选择文档所属分类：</span>
								<div class="cate-list" id="cates">
									{$cate}
									<p class="no-cate-msg">注：为了更简洁、明确的索引到你创建的文档，请为您的文档选择一个合适的分类！</p>
								</div>
								<p class="cate-msg"></p>
							</div>
							<div class="form-item">
								<button class="create-btn">设置文档</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</section>
</block>
<block name="js">
    <script src="__STATIC__/common/js/qiniu/plupload.full.min.js?v=__VERSION__"></script>
    <script src="__STATIC__/common/js/qiniu/qiniu.js?v=__VERSION__"></script>
	<script>
		var did = {$doc.id};
	</script>
	<script src="__STATIC__/doc/js/setDoc.js?v=__VERSION__"></script>
</block>
